<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>表信息</title>
    <link rel="stylesheet" href="/bus/js/css/layui.css" media="all">
    <link rel="stylesheet" href="/bus/upDataMain/style.css?t=1617720346170" media="all">
    <style>
        body {
            margin: 10px;
        }

        .layui-code-view {
            display: block;
            margin: 10px 0;
            padding: 3px;
            border: 3px solid #f5f5f5;
            border-left-width: 6px;
            background-color: #FAFAFA;
            color: #333;
            font-family: Courier New;
        }

    </style>
</head>
<body>


<div class="layui-tab layui-tab-brief" lay-filter="mytab">
    <ul class="layui-tab-title">
        <li th:each="gen, userStat : ${genMap}" th:text="${userStat.current.key}"
            class="layui-tab-item" th:classappend="${userStat.index == 0} ? 'layui-this' : '' "
        >表信息
        </li>
    </ul>

    <div class="layui-tab-content">

        <div th:each="gen, userStat : ${genMap}" class="layui-tab-item"
             th:classappend="${userStat.index == 0} ? 'layui-show' : '' ">
            <button class="js-clipboard layui-btn layui-btn-normal layui-btn-sm"
                    th:data-clipboard-target="'#selected'+${userStat.current.key}">复制
            </button>
            <pre th:id="'selected'+${userStat.current.key}" class="layui-code-view" lay-title="JavaScript"
                 lay-skin="notepad" th:text="${userStat.current.value}">//在里面存放任意的文本内容
             </pre>
        </div>
    </div>


</div>


<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
    <a class="layui-btn layui-btn-xs" lay-event="more">更多 <i class="layui-icon layui-icon-down"></i></a>
</script>


<script src="/bus/js/layui.js"></script>
<script src="/bus/clipboard.min.js"></script>
<script>
    var $ = layui.$;

    var clipboard;
    $(function () {
        clipboard = new ClipboardJS('.js-clipboard');
        clipboard.on('success', function (e) {
            console.log(e)
            layer.msg('复制成功');
        });
        clipboard.on('error', function (e) {
            console.log(e)
            layer.msg('复制失败');
        });

    });

</script>
</body>
</html>
